make extendable and some fixes