Some refactor and update to new version of Deuterium