updated with refactoring run method