Refactor Dockerfile and lots of minor fix