Revert "improved #17: refactor code"

This reverts commit 505fb2191f9c0f92e9ad03575207cefa2d656015.