first step of massive refactoring