Refactor sample and better inheritance handling. TODO think about inheritance name collisions.