Refactored and hitting closest target