remove unused function case, add var declaration