Moving script into a more module/class set up to aid maintainers after myself