assorted app code fixes for code quality, type safety, useless imports