More work in progress moving code to the correct places.