Remove pdb; cleanup constants; simplify; add defaults