another minor refactoring (+ unit testing)
yet another minor refactoring...
yet another minor refactoring