GUI code refactored, JavaDoc comments added