fix bug in inputformat, add some type hinting, cleanups