simplified rules and parseHref
added format comment