Refactor: Add lock.py