Get rid of module level code execution and some small fixes:

* `delete` function was fixed
(missed parameter was added)
* code style fixes in modified functions
Merge pull request #1 from 'fix/module-level-code-exec'

Get rid of module level code execution and some small fixes.