refactoring to simplify things a little bit