this can also be inlined below as $parsed is only used once