Clean code. Add logging. Remove unused values from config