this check is repeted in every format method, maybe it should be moved to other place