fixing self.keys reference and removing a lot of crud