lots of changes!
added loading template