Refactor base strucure