refectoring,retrive service,constant and factory