move locks to common place