1. A computer-implemented method to refactor a software application, the computer-implemented method comprising: accessing at least a portion of a software application that can execute in an operating environment where there are more two or more threads of execution; determining if there is at least one lock used in the software application to enforce limits on accessing a resource; in response to determining there is at least one lock with a first type of construct with a given set of features, refactoring at least a portion of the software application with the lock to preserve behavior of the software application, by determining at least one type of usage of the lock including which type of usages of the lock must be refactored together; and reassigning the lock to one of a set of lock usages with a second type of construct and transforming the identified lock usages to the corresponding usages for the second type of construct.