Cleaned up code and added TODOs