fixed light theme invisible text bug, code refactoring, other bug fixes

fixed light theme invisible text bug, code refactoring, other bug fixes