Refactored some of the functions