Rename and restructure and some bug fixes.