More re-factoring, fixing errors