Made projection method more DRY.

Move some macro helpers into their own class.