refactoring commands resources