refactoring and id added