restructured app to use prototypal inheritance.