Cleanup some  javascript code and make year view