Develop

Move functionality to lib