[Refactor] Cleanup and refactor