reorganized the structure for PSR-0 compliance