refactored part of locking in scene