remove unused functions, debug cleanup