raise NotImplementedError for stub methods instead of pass
make as_string a staticmethod