Refactor top level file