Add logging and some TODOs