You can just put the styling in if else instead of entire thing.