trying to fix not defined issue on codeclimate
Reduced complexity of the render method