refactoring

Started replacing methods implmented by libsphia, hope i am doing it right? not sure about the travis setup for test. 
/help