Refactored even more code.