Refactoring of companies code and some fixes