Added logic to repository