cleanup + some fixes