apply requested style changes

- change named functions to anonymous inlined parameters
- change single return to three if/thens