Add analytics and refactor configuration.