Clean up frontend code