Refactor

Refactored many classes