Changes priority of samples.  Code refactoring.