Refactor ChromeProfile for better code structure and log errors better