refactor

some refactoring, intel xdk still broken