updates to class contructors, minor optimizations, general cleanup