refactor to work with new fronted