MLDS-256 moving functions in controller into service