Code cleanup/organization/consolidation