Remove redundant code and move services to model