WIP Code tidyup