Re-factored the class