added repository pattern and some services