A lot of small fixes, some cleaning up done and change a lot of names to match conventions