there is a way you could use inject where you would not need this if statement.