Refactored some large methods