Refactoring some methods