refactored code to match with new helper functions sass file