Some refactoring for pull request
https://github.com/wicketstuff/core/pull/371