diff --git a/satella/coding/concurrent/queue.py b/satella/coding/concurrent/queue.py
index 4c34955b9213a1717284dde4d6a0aac79d5a4e86..8df1a49d96c99af5f524e00daee37a9b0cdf7109 100644
--- a/satella/coding/concurrent/queue.py
+++ b/satella/coding/concurrent/queue.py
@@ -44,6 +44,33 @@ class PeekableQueue(tp.Generic[T]):
                 self.queue.append(item)
         self.inserted_condition.notify(items_count)
 
+    def __get_timeout_none(self, item_getter):
+        while True:
+            self.lock.release()
+            self.inserted_condition.wait()
+            self.lock.acquire()
+            if len(self.queue):
+                try:
+                    return item_getter(self.queue)
+                finally:
+                    self.lock.release()
+
+    def __get_timeout(self, item_getter, timeout):
+        with measure(timeout=timeout) as measurement:
+            while not measurement.timeouted:
+                self.lock.release()
+                # raises WouldWaitMore
+                self.inserted_condition.wait(timeout=measurement.time_remaining)
+                self.lock.acquire()
+                if len(self.queue):
+                    try:
+                        return item_getter(self.queue)
+                    finally:
+                        self.lock.release()
+            else:
+                self.lock.release()
+                raise Empty('queue is empty')
+
     @rethrow_as(WouldWaitMore, Empty)
     def __get(self, timeout, item_getter) -> T:
         self.lock.acquire()
@@ -55,30 +82,9 @@ class PeekableQueue(tp.Generic[T]):
                 self.lock.release()
         else:
             if timeout is None:
-                while True:
-                    self.lock.release()
-                    self.inserted_condition.wait()
-                    self.lock.acquire()
-                    if len(self.queue):
-                        try:
-                            return item_getter(self.queue)
-                        finally:
-                            self.lock.release()
+                return self.__get_timeout_none(item_getter)
             else:
-                with measure(timeout=timeout) as measurement:
-                    while not measurement.timeouted:
-                        self.lock.release()
-                        # raises WouldWaitMore
-                        self.inserted_condition.wait(timeout=measurement.time_remaining)
-                        self.lock.acquire()
-                        if len(self.queue):
-                            try:
-                                return item_getter(self.queue)
-                            finally:
-                                self.lock.release()
-                    else:
-                        self.lock.release()
-                        raise Empty('queue is empty')
+                return self.__get_timeout(item_getter, timeout)
 
     def get(self, timeout: tp.Optional[float] = None) -> T:
         """
diff --git a/satella/coding/metaclasses.py b/satella/coding/metaclasses.py
index 43dc1501792be74818266fe41b47a97e04e9f01f..9e35cf5b05fc1a9d1e90573152cdb7ee1b3eaf9e 100644
--- a/satella/coding/metaclasses.py
+++ b/satella/coding/metaclasses.py
@@ -70,19 +70,17 @@ def DocsFromParent(name: str, bases: tp.Tuple[type], dictionary: dict) -> tp.Typ
     """
     if '__doc__' not in dictionary:
         for base in walk(bases, _extract_bases, deep_first=False):
-            if hasattr(base, '__doc__'):
-                if base.__doc__:
-                    dictionary['__doc__'] = base.__doc__
-                    break
+            if hasattr(base, '__doc__') and base.__doc__:
+                dictionary['__doc__'] = base.__doc__
+                break
 
     for key, value in dictionary.items():
         if not value.__doc__ and callable(value):
             for base in walk(bases, _extract_bases, deep_first=False):
-                if hasattr(base, key):
-                    if getattr(base, key).__doc__:
-                        value.__doc__ = getattr(base, key).__doc__
-                        dictionary[key] = value
-                        break
+                if hasattr(base, key) and getattr(base, key).__doc__:
+                    value.__doc__ = getattr(base, key).__doc__
+                    dictionary[key] = value
+                    break
     return type(name, bases, dictionary)
 
 
diff --git a/satella/coding/structures/syncable_droppable.py b/satella/coding/structures/syncable_droppable.py
index a1f4c0a42bda220aaacb728dd84233eb0470f200..4bfd2975ae21dc705b5928600278686b81b45d06 100644
--- a/satella/coding/structures/syncable_droppable.py
+++ b/satella/coding/structures/syncable_droppable.py
@@ -332,6 +332,19 @@ class SyncableDroppable(RMonitor, tp.Generic[K, V]):
         finally:
             try_close(iterator)
 
+    def __append_item(self, data, iterator, maximum_entries):
+        while len(data) < maximum_entries:
+            try:
+                data.append(next(iterator))
+            except StopIteration:
+                for index, tpl in enumerate(self.data_in_memory):
+                    if len(data) >= maximum_entries:
+                        break
+                    if self.synced_up_to is not None:
+                        if tpl[0] > self.synced_up_to:
+                            break
+                return itertools.chain(data, self.data_in_memory[:index])
+
     def _on_sync_request_synced_up_is_not_none(self, maximum_entries):
         if self.first_key_in_memory <= self.synced_up_to:
             # Means we have to sync from memory
@@ -349,18 +362,7 @@ class SyncableDroppable(RMonitor, tp.Generic[K, V]):
             data = []
             iterator = self.db_storage.iterate(self.start_entry)
             try:
-                while len(data) < maximum_entries:
-                    try:
-                        data.append(next(iterator))
-                    except StopIteration:
-                        for index, tpl in enumerate(self.data_in_memory):
-                            if len(data) >= maximum_entries:
-                                break
-                            if self.synced_up_to is not None:
-                                if tpl[0] > self.synced_up_to:
-                                    break
-                        v = itertools.chain(data, self.data_in_memory[:index])
-                        break
+                v = self.__append_item(data, iterator, maximum_entries)
             finally:
                 try_close(iterator)
         return v
diff --git a/satella/os/misc.py b/satella/os/misc.py
index 5794078c12cf1d2703a122be8d42945a2b419f8b..60663870309da9f7c00cc0732fa70fbf45e62e33 100644
--- a/satella/os/misc.py
+++ b/satella/os/misc.py
@@ -27,18 +27,20 @@ def whereis(name: str) -> tp.Iterator[str]:
         available_extensions = '',
 
     for directory in paths_to_look_in:
-        with silence_excs(FileNotFoundError):
-            for file in os.listdir(directory):
-                path = os.path.join(directory, file)
-                if 'x' not in stat.filemode(os.stat(path).st_mode):
-                    continue
-
-                if sys.platform.startswith('win'):  # a POSIX-specific check
-                    file = file.upper()  # paths are not case-sensitive on Windows
-
-                for extension in available_extensions:
-                    if file == '%s%s' % (name, extension):
-                        yield path
+        yield from _whereis(directory, name, available_extensions)
+
+
+@silence_excs(FileNotFoundError)
+def _whereis(directory: str, name, available_extensions):
+    for file in os.listdir(directory):
+        path = os.path.join(directory, file)
+        if 'x' in stat.filemode(os.stat(path).st_mode):
+            if sys.platform.startswith('win'):  # a POSIX-specific check
+                file = file.upper()  # paths are not case-sensitive on Windows
+
+            for extension in available_extensions:
+                if file == '%s%s' % (name, extension):
+                    yield path
 
 
 def is_running_as_root() -> bool: