fix code style
fix some exception messages
fix namespace usage for functions and constants
remove some todo's