wp8. code refactoring