Refactor to using flux

:sweat_drops: