refactored a bit, made it more explicit