extract class to make code more readable