Several improvements to app code quality