refactoring by Sevak