start refactoring + merge fix