revision 2, cleaning views code