refactored models module
moved use_function to controller