simplified the ssr code