Defined three new methods to refactor code