migration to plan 9-style code and other minor cosmetic changes