Added decorator and cleaned up a few bits and pieces