fixing refactor issues