clean up locking stuff slightly