more refactoring of the filth