refactoring to allow better chaining of methods