split files up & refactored