refactor with new javafx version