Refactoring + serving file from lua