Shorten lines

and copy over a check for flair (IIRC, it was added because someone
didn't have any and it didn't respond)
Define once

Codacy doesn't like function definitions inside if blocks. Not terribly
important.