Move library class into its own file