refactored repetitive code into functions
refactored repetitive code into functions