JFA: clean-up and major refactoring (#116)