fixed opts and some cleanups