Refactored the way square types are retrieved and consumed
Misc cleanup. Final commit for now