refactored sfml export code to class