Clean and refactor