rearranged 404 behavior, made it more global, extensible