Use new OneSky API, code refactoring