More refactoring as per matysek.