Changed file structure
Divided code logic and behaviour