Clean up function input