Reverting changes related to last commit as they didn't resolve NPE

This reverts commit 3dbc66ef2c4681163787b5e63469d54c21f31324.