first part of final refactor