refactored to use Profile class