mostly code beatifying
some comments on dev/prod choosing logic