remove `return`s and clean up some conditionals