Cleaning up function validation