Refactor credit card net form and javascript