added template functions, removed label class