Add internal extend function + coding style