finshed type to Enum switch + some bugfixes