Moved non gameplay code out to engine