Improved Supervisor locking policy and small refactorings