Further consolidation of the code.