Re-applying changes from demo to bundle
Merge pull request #325 from Bladrak/factorize

Re-applying changes from demo to bundle