moving injected fields more properly where they belong
simplified - removed some boilerplate
slightly polished code