Some refactoring and updated build images