added som TODOs and cleaned up some code