refactoring + support for One-page checkout