minor refactor of if style