cleaned up frontend code