Refactored to fit application model