Refactor some of validation module into global helpers