Cleanup, refactor, environment-based configs