Move callback to its own function, remove class