refectoring , not finished