STAmount refactoring down payment

No change in functionality. Moved a bulk of members to outside the class and regrouped everything to be orderly.