     private func popRandomLgtm() -> Lgtm? {
         let lgtm = stack.dequeue()
         if let lgtm = lgtm {
-            if history.count >= 200 {
+            if history.count >= HistoryLimit {
                 history.dequeue()
             }
             history.enqueue(lgtm.url)

    /// fetch from lgtm.in/g to limit
    private func fetchLgtmFromServer() {
        fetchFromServer { [unowned self] in
            if self.stack.count < self.stackLimit {
                // fetch until stack.count reaches to limit
                self.fetchLgtmFromServer()
            } else {

    private var fetching = false
    private var fetchingRealm = false
    private static let sharedInstance:Provider = Provider()
    private let StackLimit = 20
    private var stack:Queue<Lgtm> = []
    private var favStack:Queue<Lgtm> = []
    private let HistoryLimit = 200
    private var history:Queue<String> = []
}
/// static method interfaces
