changed a couple lines to avoid repeated chained method calls