Make it a lib. Close #1