Implemented hierarchy structure and its builder from model records