little bit more refactoring of the master