Refactor code for upcoming alpha patches.