Update packages + refactoring