there are many changes in this class which don't belong in this commit