Code cleanup

- use proper check on if
- use string interpolation
- reduce boolean logic to minimum on match.