package hier. refactored