Simplifying the code by moving the conditionals to show the render
check withing it's own function