Added helper method to reduce code redundancy.