modularize record/rest