Refactoring. Getting rid of repetition.