fix indentation issues + remove unneded syso + refactor some code