Refactor server so file is loaded once