Template method created to reduce code duplication