Removed deprecated code that caused bugs