Jc 2032 code review refactoring

http://jira.jtalks.org/browse/JC-2032
Too large.. Should be refactored, otherwise it's not clear what's tested.