refactoring of terms to be cleaner, less code repetition