Made unnecessary public inheritance private, removed code duplication