fix issues related to auto bind

refractor into factories for classes.