Refactored several classes