refectoring
rest adapter