addressed review comments and some cleanup of unused code

@dknochen fancy stuff :))))