Started cleanup. Moving towards platform indepdent middle interface.