remove unused function and struct