slightly refactoring