replaced recursive angular template with jqlite dom manipulation (for performance reasons)