refactor io in smt prelude

@andreistefanescu please review