Refactor to prevent grutor file from being so long.