refactoring: a bit nicer