Cleaned hierarchy a bit and code.