Make buildHandler static to prevent possible circular refs