added tests for player class and some Refactoring on it