Removing backend logic from frontend