Fix code reivew comments

- Use module label instead of module type when detecting pre-existing deployment in
the container
- Refactoring changes