Core refacturing - nearly finished for now