minor restructuring into smaller files