refactored the swing server