preconditions refactoring