Fixed Syntax and made it more DRY