fixed test, code improvement