Input streams

Same comment here: ideally streams should be closed in the same method where they're opened (if possible) as it makes it easier to track and debug.