refactor structure up to framework