Refactor into separated files