validation updated
code refactoring