Improvements to the code :metal: