Simplified main plugin code