some corrections after refactoring