Above code could be extracted to separated method