refactored cybin code