code function in service module