Refactoring. Todo: Think how to cache object rather than byte[] .