#1167 refactoring