Validation could go in this function as well