move www files to /public dir, refactor, improvements