Refactor gbuffer extractors
Merge branch 'master' into merged_40_and_41