minor refactoring previous commit