Refactoring
Tests (not working)