Code reorg

Continue organizing code to avoid unnecessary #defines