Refactor. Better usage of Factory Pattern.