More modularity, bugfixes