refactored loading of input boxes to ajax