easier lock implementation