start refactor
now working