Some refactoring and implemented some helper methods