Implement target locking
Code refactoring
Add test case
Merge pull request #5 from wcandillon/locktarget

Implement target locking