Create and remove docker container; refactoring