merged 2 methods into 1