Refactored and removed some TODO