Clean up input