Refactor into other file