moved more logic server-side