Refactoring to share docker images