Some minor code duplication reduction