Refactored prototype