Formatting
Some refactoring and added TODOs