Added some additional refactoring