refectoring attempts