Finalized idValidator

Code refactoring as well.