frontend logic