Changed magCharSet over to module using free functions instead of class based approach, works well