refactoring a bit...