restructured to use more logical approach from updated generator-web