refactoring and improvement on method execucation of resouces