Updated and prepared for JavaFX support