refactored and rebundled L2 based SGD