[fixed] refactoring and bad smell fixes