refactored templating, added ajax tracking
added TODO note