changed structure for clarity