introduced prototype bean function and made context injecteable