removed some TODOs and improved documentation