refactor the following methods. consider the following: - reduce repetition and use greater abstraction where possible - do not use then clauses - do not use for loops, use maps, filter, reduce instead - break complex functionality up into smaller functions - increase efficiency - increase readability