removed deprecated code, major uner-the-hood improvements.