Fixed prototype model to use closure instead