removed obsolete code and fixed test