More reworking of code