refactor jsp code