Efficiency and some fixes