Removing depricated code and functions