Reformat plugin code, refactor constructor and getter/setter method to be more easily unit tested.