handle exceptions, resolv TODOs