refactor get locks