some refactoring based on changes for ID-166