extract prototype extends to a separate file

+ use lib folder