Cleanup and less duplication.