Remove static qualifier, restore some removed code