various fixes + moving bits around