removing instance detection code and instead just passing 'this' correctly