Refactored some code, added some preconditions/an action.