Refactor several types also view script (jsp)