started to refactor