clean up locking code, removing dead code