Refactor: split into multiple files