Refactor Extendable and add unit test