Minor code refactor & Cosmetic changes