Refactor everything into proper files.