consolidated 2 methods into one