It comes from the samurai moral code and gives great importance to certain virtues like frugality , loyalty , martial arts mastery and honor until death .
BushidÅ expanded and formalized the earlier code of the samurai , and stressed frugality , loyalty , mastery of martial arts , and honor to the death .