removed all services and replaced them by repository pattern; moved factory, singleton and repository in different folders; added tests