Move validation functions into function being exported