fixes #250 + code optimization and cleaning
Merge pull request #263 from Catrobat/issue-#250

fixes #250 + code optimization and cleaning