Some fixes regarding the refactorins.