TODO: delete all unused functions