Refactored into multiple files