modularize the back-end