Better input handling