Rearranged some input handler stuff