more refactoring that could not work