Refactor with globals
Merge pull request #14 from NikZar/refactor

Refactor with globals