Some cleanup of unused functions