Refactor

Move code to different package
Get some gen working