refactoring
Merge pull request #19 from lukaselmer/refactoring-and-static-code-analysis

Refactoring and static code analysis fixes