start to refactor