refactor to yupe core