Reducing the calls to raw
Simplifying template parameters for the sample template tab
Passing the study to subtabs instead of the study id, to reduce accesses to the database
Reducing DB accesses