more const correctness + cleaups