PyCAL module refactor