Remove unnecessary definitions and a function