End of file refactor