JS View model and view work, restructuring and clean