code cleaning part 3 (lock and dangerous things)