refactor parent container resolver to avoid duplication, must add unit test on that