Added some TODOs and exception handling