Code refactor, preparing to switch rendering methods.