Modify helper method to use string interpolation and shorter conditionals.