Refactored and renamed some methods