Cleaned up get_sections functionality.