adds methods to code, makes it dryer