Tidying up method into module_function