refactor backend.php to controller.php and model.php