input parsing and callbacks