Removing left factoring from Context-Free Grammar


I know that, removing left factoring is a simple task.
And i understand following procedure:

$ S→aA | aB$
Becomes:
$ S→aS’$
$ S’→A|B$

Yet I’m running into problems with this particular grammar:

$ S→AD|bbS|bScS|BS $
$ A→aAbb | abb$
$ B→aB|ba|b$
$ D→cDd|cccd$

How to remove left factoring from it, I’m trying to convert it into LL(1) grammar