Re-factored some classes