Abstracted and cleaned up input