Reviewed code, made some refactoring, added some TODOs