further fixing after refactor