add output-interval and restructure engine