Minor refactoring to try out partial function application and chaining.