cleaned code and fixed resolver