extracted functionality into separet class