removed redundancies and legacy code
removed redundancies and legacy code