FXEP-22: Tidied up the code, refactored into smaller methods and added in slf4j + logback logging.