why use a class here instead of just exporting the check function?