created run method and separate by packages some functions